extends BallState

# ===============================================

func enter() -> void:
	if not ball.is_node_ready():
		await ball.ready
	ball.decection_area.body_entered.connect(__on_player_entered)


func exit() -> void:
	ball.decection_area.body_entered.disconnect(__on_player_entered)

# ===============================================

func __on_player_entered(body: Player) -> void:
	ball.carrier = body
	state_transition.emit(self, State.CARRIED)
